﻿@using hc.epm.DataModel.Basic;
@using System.Collections.Generic;
@using hc.epm.ViewModel;
@model List<ProjectView>
@{
    ViewBag.Title = "视频管理";
}
<style>
    .topBox {
        border-bottom: 2px solid #00ccff;
    }

        .topBox button {
            padding: 6px 16px;
            margin-bottom: 0;
            font-size: 16px;
            line-height: 1.42857143;
            text-align: center;
            white-space: nowrap;
            vertical-align: middle;
            width: 140px;
        }

    .activeh {
        border: none;
        color: #fff;
        background-color: #00ccff;
        border: 1px solid #00ccff;
    }

    .deactive {
        color: #00ccff;
        border: 2px solid #00ccff;
        background-color: #fff;
        border-bottom: 1px solid #00ccff;
    }

    .fa-wrap {
        margin-top: 10px;
        width: 100%;
    }

    .fa-com {
        height: 30px;
        width: 210px;
        border-radius: 5px;
    }

    .form-sub {
        display: inline-block;
        margin-left: 35px;
    }

        .form-sub > button {
            width: 150px;
            height: 35px;
            border: none;
            background-color: #6a6969;
            color: #fff;
        }
</style>
<div class="contentData" style="min-height:500px;">
    <div class="topBox">
        <button id="normal" class="deactive">正常视频</button>
        <button id="lose" class="activeh">视频丢失</button>
    </div>
    <div class="fa-wrap">
        <form method="get">
            <label>地市公司：</label>
            <span>
                @Html.DropDownList("companyId", ViewBag.CompanyName as SelectList, null, new { @class = "fa-com" })
            </span>
            <label style="margin-left:20px;">@ViewBag.Date</label>

            <div class="form-sub">
                <button type="submit" id="btnsel">查 询</button>
            </div>
        </form>
    </div>
    <div class="tab-list" style="margin-top: 20px;">
        <table class="datalist" style="word-break:break-all;word-wrap:break-word;">
            <thead>
                <tr>
                    <th width="200">序号</th>
                    <th>项目名称</th>

                </tr>
            </thead>

            <tbody id="tbody">
                @{
                    int index1 = (ViewBag.pageIndex - (ViewBag.pageIndex - 1)) * ((ViewBag.pageIndex - 1) * 10);
                }
                @if (Model != null && Model.Count() > 0)
                {
                    foreach (var item in Model)
                    {
                        index1++;
                        <tr>
                            <td>@index1</td>
                            <td>
                                <span style="cursor:pointer;color:blue;">@item.Name</span>
                            </td>
                        </tr>
                    }
                }
                else
                {
                    <tr>
                        <td colspan="2" class="table-center">
                            暂无数据
                        </td>
                    </tr>
                }

            </tbody>
        </table>

        <div id="page" style="text-align:right; margin-right:5px;"></div>
    </div>

</div>
<script>
    $("#normal").click(function () {
        window.location.href = "/VideoManage/Index";
    });
    layui.use(['layer', 'element', 'laypage'], function () {
        var layer = layui.layer, form = layui.form, element = layui.element, $ = layui.jquery, laypage = layui.laypage;
        //分页
        laypage.render({
            elem: 'page',
            count: '@ViewBag.Total',
            curr: '@ViewBag.pageIndex',
            layout: ['prev', 'page', 'next', 'skip', 'count'],
            theme: '#6a6969',
            jump: function (obj, first) {
                if (!first) {
                    //得到了当前页，用于向服务端请求对应数据
                    var curr = obj.curr;
                    var search = $("form").serialize();
                    window.location.href = "/VideoManage/VideoFailure?pageIndex=" + curr + "&" + search;
                }
            }
        });
    });
</script>
